package org.opu.queryhandler.n.client;

import javax.swing.UIManager;
import org.opu.queryhandler.n.client.services.ConnectionService;
import org.opu.queryhandler.n.client.services.DataRepresentationService;
import org.opu.queryhandler.n.client.services.DatabaseService;
import org.opu.queryhandler.n.client.services.DriverService;
import org.opu.queryhandler.n.client.ui.MainFrame;
import org.opu.queryhandler.n.util.ConfigPath;
import org.opu.queryhandler.n.util.FileIO;
import org.opu.queryhandler.n.util.JProperties;

/**
 * Hello world!
 *
 */
public class App {

    public static void main(String[] args) {
        JProperties prop = null;
        try {
            prop = new JProperties(FileIO.load(ConfigPath.getInstance().getFrameProp(), prop));
            UIManager.setLookAndFeel(prop.getProperty(MainFrame.LAF,
                    UIManager.getSystemLookAndFeelClassName()));
        } catch (Exception ex) {
        }

        EventBus events = new EventBus(new DatabaseService(), new DriverService(),
                new ConnectionService(), new DataRepresentationService());
        MainFrame mf = new MainFrame(prop, events);
        mf.setVisible(true);
    }
}
